Repository navigation
feat(mcp): forward hooks_timeout, min_confidence and sort_by_length on laya_predict_batch - #766
Merged
Merged
Conversation
…t_batch Gaps found: MCP batch tool omitted 3 per-call controls that Router.predict_batch accepts. - Added hooks_timeout (float), min_confidence (float), sort_by_length (bool) as optional parameters - Forward all three through to router.predict_batch() in tools.py - Updated server wrapper to accept and pass them through - Test suite validates forwarding with BatchRouter tracking kwargs - Mutation-check: gate ensures these knobs reach Router.predict_batch
This was referenced Sep 30, 2026
Owner
|
Merged for 0.3.23. Verified on the integrated branch, not on the PR in isolation: every suite in the Thank you. |
This was referenced Oct 4, 2026
2 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
laya.mcp.tools.laya_predict_batchand its server wrapperlaya_predict_batch_toolnow accept and forward three per-call controls thatRouter.predict_batchhas always taken:hooks_timeout,min_confidence, andsort_by_length.Why
Router.predict_batchgrew these knobs (#577 for hooks, #583 for token budgets, #654 for sort-by-length) but the MCP layer only ever forwardedbatch_size. A caller using the MCP server cannot:Every one of those is reachable from
laya_predict(single) orRouter.predict_batch(in-process); only the MCP batch tool swallows them. This is the same shape as the forwarding gaps already fixed for CLI (--min-confidence,--sort-by-length) and for the demo server.How it was verified
The
BatchRouterfixture now records the kwargs it was called with. Four new assertions intest_batch_predictcheck thathooks_timeout=5.5,min_confidence=0.75, andsort_by_length=Trueare forwarded with those exact values, and that a plainlaya_predict_batch(BATCH_REQUESTS, router=...)call leaves all three out of the kwargs entirely (so old strict stubs keep working).Checklist
mainFixes #